Crate sea_orm_macros

source ·

Derive Macros

A derive macro to implement sea_orm::ActiveEnum trait for enums.
The DeriveActiveModel derive macro will implement ActiveModelTrait for ActiveModel which provides setters and getters for all active values in the active model.
Models that a user can override
The DeriveColumn derive macro will implement [ColumnTrait] for Columns. It defines the identifier of each column by implementing Iden and IdenStatic. The EnumIter is also derived, allowing iteration over all enum variants.
Derive a column if column names are not in snake-case
Create an Entity
This derive macro is the ‘almighty’ macro which automatically generates Entity, Column, and PrimaryKey from a given Model.
Derive into an active model
The DeriveMigrationName derive macro will implement sea_orm_migration::MigrationName for a migration.
The DeriveModel derive macro will implement ModelTrait for Model, which provides setters and getters for all attributes in the mod It also implements FromQueryResult to convert a query result into the corresponding Model.
The DerivePrimaryKey derive macro will implement [PrimaryKeyToColumn] for PrimaryKey which defines tedious mappings between primary keys and columns. The [EnumIter] is also derived, allowing iteration over all enum variants.
The DeriveRelation derive macro will implement RelationTrait for Relation.
Convert a query result into the corresponding Model.